package com.wecon.springdemo.pattern.template.order;

import com.wecon.springdemo.mapper.TemplateMapper;

/**
 * @author Weikang  Wang
 * @program: com.wecon.springdemo.pattern.template.order
 * @description:
 * @date 2020/5/11 13:18
 */
public class CompanyC extends AbstractCompany {

    public CompanyC(TemplateMapper templateMapper) {
        super(templateMapper);
    }

    @Override
    String setString(String jsonData) {
        System.out.println("C setString");
        String result = jsonData;

        result = result.replaceAll("[\"]order_id[\":]", "\"orderId\"");
        result = result.replaceAll("[\"]order_price[\":]", "\"orderPrice\"");
        result = result.replaceAll("[\"]product_id[\":]", "\"productId\"");
        result = result.replaceAll("[\"]product_count[\":]", "\"productCount\"");
        result = result.replaceAll("[\"]pay_price[\":]", "\"payPrice\"");
        result = result.replaceAll("[\"]real_pay_price[\":]", "\"realPayPrice\"");
        result = result.replaceAll("[\"]user_id[\":]", "\"userId\"");
        result = result.replaceAll("[\"]order_date[\":]", "\"orderDate\"");
        result = result.replaceAll("[\"]pay_status[\":]", "\"payStatus\"");

        return result;
    }

}
